package com.asiainfo.hybridapp.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;

import com.framework2.utils.ThreadPoolUtil;

/**
 * 用来解决透明主题bug的闪屏页
 *
 * @author Yangjie
 * className SplashActivity
 * created at  2017/4/27  10:03
 */
public class SplashActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ThreadPoolUtil.getInstance().getInstanceSingleTaskExecutor().submit(new Runnable() {
            @Override
            public void run() {
                try {
                    Thread.sleep(1000);
                    finish();
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        });

//        if (!TextUtils.isEmpty(RSAmethod.rsaDecrypt(this, PreferencesHelper.getInstance().getStringData(ConstantsME
//        .PHONE)))
//                && !TextUtils.isEmpty(PreferencesHelper.getInstance().getStringData(ConstantsME.token))
//                && PreferencesHelper.getInstance().getBooleanData(ConstantsME.LOGINED)
//                && !TextUtils.isEmpty(PreferencesHelper.getInstance().getStringData(ConstantsME.currentShopId))) {
//
//            startActivity(new Intent(SplashActivity.this, HomepageActivity.class));
//        } else {
//            startActivity(new Intent(SplashActivity.this, LoginActivity.class));
//        }

        startActivity(new Intent(SplashActivity.this, LocationActivity.class));
    }
}
